<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>互联网村镇管理平台</title>
    <link rel="stylesheet" type="text/css" th:href="@{/css/common.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/css/main.css}" />
    <link th:href="@{/js/libs/jquery.treetable/jquery.treetable.css}" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="container clearfix">
        <!--/sidebar-->
        <div class="main-wrap">
            <div class="crumb-wrap">
                <div class="crumb-list">
                    <i class="icon-font">&#xe973;</i>
                    <a href="javascript:void(0);">统计分析</a>
                    <span class="crumb-step">&gt;</span>
                    <span class="crumb-name">商家统计</span>
                </div>
            </div>
            <div class="search-wrap">
                <div class="search-content">
                    <form onsubmit="selectTreeTableData();return false;" method="post" id="queryForm">
                        <table class="search-tab" style="margin-left: 10px;">
                            <tr>
                                <th width="70">机构名称:</th>
                                <td>
                                    <input class="common-text" placeholder="机构名称" id="orgName"  name="orgName" th:value="${orgName}" type="text" />
                                </td>
                                <th width="70">机构电话:</th>
                                <td>
                                    <input class="common-text" placeholder="机构电话"  id="orgPhone" name="orgPhone" th:value="${orgPhone}" type="text" />
                                </td>
                                <td>
                                    <input class="btn btn-primary btn2" name="sub" value="查询" type="submit">
                                </td>
                                <td>
                                    <input class="btn btn-primary btn2" name="sub" value="导出" type="button" onclick="javascript:exportOrg();">
                                </td>
                            </tr>
                        </table>
                    </form>
                    <!--导出-->
                    <form id="exportForm" action="exportOrg" method="post">
                        <input type="hidden" name="orgName_org" id="orgName_org"/>
                        <input type="hidden" name="orgPhone_org" id="orgPhone_org"/>
                    </form>
                </div>
            </div>
            <div class="result-wrap">
                <!--<div class="result-title">
                    <div class="result-list">
                        <a id="batchDel" href="javascript:exportOrg();"><i class="icon-font"></i>导出</a>
                    </div>
                </div>-->
                <div class="result-content">
                    <table class="result-tab" width="100%" id="treeTable">
                        <tr>
                            <th class="tc" width="5%"><input class="allChoose" onclick="javascript:shiro.form.setCheckBoxSelectToggle('orgIdCheckBox');" type="checkbox" /></th>
                            <th width="20%">机构名称</th>
                            <th width="20%">机构别名</th>
                            <th width="20%">机构电话</th>
                            <th width="20%">机构传真</th>
                            <th width="20%">机构网址</th>
                            <th width="20%">机构说明</th>
                            <th width="20%">添加时间</th>
                            <th width="20%">更新时间</th>
                        </tr>
						<tbody id="treeTableBody">
                        </tbody>
                    </table>
                </div>
                <!-- <div class="list-page" th:utext="${pageHtml}">
                </div> -->
            </div>
        </div>
    </div>
    <div th:include="admin/common/common"></div>
    <script type="text/javascript" th:src="@{/js/libs/jquery.treetable/jquery.treetable.js}"></script>
    <script type="text/javascript" th:src="@{/js/web/org/orgNum.js?v=1.1}"></script>
    <script type="text/javascript" th:src="@{/js/libs/shiro.js}"></script>
    <script type="text/javascript">
 // 初始化treeTable属性
    var option = {
    	expandable:true,
        column:1,
        clickableNodeNames:true
    };

    $("#treeTable tbody").on("mousedown", "tr", function() {
        $(".selected").not(this).removeClass("selected");
        $(this).toggleClass("selected");
    });
  //页面加载表格
    $(function(){
    	selectTreeTableData();
    })
     //导出
     function exportOrg(){
         layer.confirm('您确定要导出商家统计信息到Excel文件？', {title:'系统消息'},function(index){
             $("#orgName_org").val($("#orgName").val());
             $("#orgPhone_org").val($("#orgPhone").val());
             $('#exportForm').submit();
             layer.msg('数据导出中...', {time: 1000});
         });

     }
    </script>
</body>
</html>